package com.junsi.mapper;

import java.util.List;

import org.springframework.stereotype.Component;

import com.junsi.bean.Approve;


/**
 * 
 * 审批接口
 *
 */
@Component
public interface ApproveMapper extends GenericMapper<Approve>{

	// 批量插入
	public int batchSave(List<Approve> approve);

	// 分页查询未批准
	public List<Approve> pageFind(Integer beginIndex,String senderID, Integer endIndex);

	// 查询行数
	public int findCount(String senderid);

	// 分页查询以批准
	public List<Approve> findByAllAlready(Integer beginIndex, String senderID, Integer endIndex);

	// 查询審核中
	public List<Approve> findApproveAmong(Integer beginIndex, String senderID, Integer endIndex);
	
	//审批人审批
	public List<Approve> tApprove(Integer beginIndex, String approverID, Integer endIndex);
	

	public Approve FindAcontractApprover(String approver,String acontractId);
	
	//更新審批意見
	public int updateRemarks(Approve approve);
	
	// 查询审批人
	public List<Approve> findapprover(String acontractApprove);

	public int batchUpdate(Approve approve);

	// 查询
	public List<Approve> findByAllAlreadyAll(String senderName);
	
	// 查询已批准,不批准
	public List<Approve> alreadyapproveAll(String senderName);
	
	//查询审批跟踪
	public List<Approve> findapproveRoleId(String id,String staffId);
	
	//插入审核 
	public int batchSaveAudits(List<Approve> approve);
	
	//分页查询所有以批准，审批失败
	public int approveCount(String senderid);
	
	//分页查询所有已批准
	public int tApproveCount(String approverID);
	
	//分页查询所有未批准:审核表
	public List<Approve> findByAllAudits(Integer beginIndex, String approverID, Integer endIndex);
	
	//分页查询:审核表
	public int findCountAudits(String approverID);
	
	//分页查询所有已批准,不审批
	public List<Approve> findByAllAuditsOne(Integer beginIndex, String approverID, Integer endIndex);
	
	//分页查询所有已批准,不审批
	public int findCountAuditsOne(String approverID);
	
	//領導審核:审核表
    public List<Approve> tApproveAuditsOne(Integer beginIndex, String approverID, Integer endIndex);
		
	//領導審核:审核表
    public int tApproveCountAudits(String approverID);
    
    //查询审批合同：未审批
    public List<Approve> findByAllContractApprove(Integer beginIndex, String senderID, Integer endIndex);
    
    //查看以审批完:开户审批
    public int CountAllApprove();
    
    //查看以审批完:开户审批分頁
    public List<Approve> findAllAudits(Integer beginIndex,  Integer endIndex);
    
    //查看以审批完: 合同审核
    public int findCountAllApproveCondition();
    
    //查看以审批完:合同审核
    public List<Approve> findAllApproveCondition(Integer beginIndex,  Integer endIndex);
    
    //时间+ 查询行数开户审批未批准---------
    public int timefindCount(String senderid,String condition);
    
    //时间+ 查询分页开户审批未批准
    public List<Approve> timefindByAllContractApprove(Integer beginIndex, String senderID,String condition,Integer endIndex);
    
    //时间+ 查询行数开户审批已批准,不审批
    public int timeapproveCount(String senderid, String condition);
    
    //时间+ 查询分页开户已批准,不审批
	public List<Approve> timefindByAllAlready(Integer beginIndex, String senderID,String condition,Integer endIndex);
	
	//时间+ 分页查询所有已批准
	public int timeTApproveCount(String approverID,String condition);
	
	//时间+ 审批人审批
    public List<Approve> timeTApprove(Integer beginIndex, String approverID,String condition, Integer endIndex);
    
    //时间+ 分页查询:审核表
  	public int timeFindCountAudits(String approverID,String condition);
  	
    //时间+ 分页查询所有未批准:审核表
  	public List<Approve> timeFindByAllAudits(Integer beginIndex, String approverID,String condition, Integer endIndex);
  	
    //时间+分页查询所有已批准,不审批
 	public int timeFindCountAuditsOne(String approverID,String condition);
 	
 	//时间+分页查询所有已批准,不审批
 	public List<Approve> timeFindByAllAuditsOne(Integer beginIndex, String approverID,String condition, Integer endIndex);
 	
 	//时间+領導審核:审核表
    public int timeTApproveCountAudits(String approverID,String condition);
    
    //时间+領導審核:审核表
    public List<Approve> timeTApproveAuditsOne(Integer beginIndex, String approverID,String condition, Integer endIndex);
    
    //时间+后台審核:开户审核
    public int timeCountAllApprove(String condition);
    
    //时间+領導審核:开户审核
    public List<Approve> timefindAllAudits(Integer beginIndex,String condition, Integer endIndex);
    
    //时间+后台審核:合同
    public int timefindCountAllApproveCondition(String condition);
    
    //时间+領導審核:合同
    public List<Approve> timefindAllApproveCondition(Integer beginIndex,String condition, Integer endIndex);
    
    public Integer findAppoveContractSun(String id);
    
    public Integer findAppoveAuditsSun(String id);
}

